//
//  FQHomeImageCollectionViewCell.swift
//  SwiftProject
//
//  Created by 董駸 on 2023/4/7.
//

import UIKit

class FQHomeImageCollectionViewCell: UICollectionViewCell {
    var model : FQHomeImageModel! {
        didSet {
            imageV.image = UIImage(named: "homeBackground\(model.type + 1)")
            switch model.type {
            case 0:
                imageV.snp.makeConstraints { make in
                    make.left.equalTo(14)
                    make.right.equalTo(-14)
                    make.top.bottom.equalToSuperview()
                }
            case 1:
                imageV.snp.makeConstraints { make in
                    make.left.equalTo(14)
                    make.right.equalTo(-14)
                    make.top.bottom.equalToSuperview()
                }
            default:
                imageV.snp.remakeConstraints { make in
                    make.centerX.equalToSuperview()
                    make.top.bottom.equalToSuperview()
                }
            }
        }
    }

    let imageV = UIImageView()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        contentView.addSubview(imageV)
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
